/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package BLL;

import DAL.DALNguoiDung;
import DTO.DTONguoiDung;
import java.util.ArrayList;

/**
 *
 * @author Documents
 */
public class BLLNguoiDung {
    DALNguoiDung dalNgDung;
    
    public BLLNguoiDung() 
    {
        dalNgDung = new DALNguoiDung();
    }
    
    public DTONguoiDung ktraDangNhap(String ten, String mk)
    {
        return dalNgDung.ktDangNhap(ten, mk);
    }
    
    public boolean doiMk(String tendn, String mk, String mkMoi) throws Exception
    {
        return dalNgDung.doiMatKhau(tendn, mk, mkMoi);
    }
    
    public ArrayList<DTONguoiDung> dsNguoiDung()
    {
        return dalNgDung.dsNgDung();
    }
   
    public boolean themNguoiDung(DTONguoiDung dtoNgDung) throws Exception
    {
        return dalNgDung.themNgDung(dtoNgDung);
    }
   
    public boolean capNhatNguoiDung(DTONguoiDung dtoNgDung) throws Exception
    {
        return dalNgDung.capNhatNgDung(dtoNgDung);
    }
    
    public DTONguoiDung capNhatNguoiDung(int id)
    {
        return dalNgDung.capNhatNgDung(id);
    }
    
    //method delete user
    public boolean xoaNguoiDung(int id)
    {
        return dalNgDung.xoaNguoiDung(id);
    }
}
